/**
 * @将一个字符串复制到另一个字符串中
 *
 * @author	 wangshikun <wangshikun2010@gmail.com>
 * @copyright	(c) 2012 wangshikun <wangshikun2010@gmail.com>
 * @license	http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package	default
 * @subpackage	default
 */

#include <stdio.h>

// call the function
void copystring(char *to, char *form);

int main(void) {
	char string1[] = {"wang shi kun"};
	char string2[50];

	copystring(string2, string1);
	printf("%s\n", string2);

	copystring(string2, "so is this");
	printf("%s\n", string2);

	return 0;
}

// copy the string
void copystring(char *to, char *form) {
	for ( ; *form != '\0'; form++,to++) {
		*to = *form;
	}

	*to = '\0';
}
